/* Yet Another Experimental Software Renderer
 *
 * Copyright (c) 2010 Pawel "Hery" Dziepak
 */

#ifndef EXECUTOR_H_
#define EXECUTOR_H_

#include <vector>

namespace yasl {
	class executor {
	public:
		enum data_type {
			dt_vertex,
			dt_texel,
			dt_float,
			dt_int,
			dt_vec2,
			dt_vec4,
			dt_color
		};

		enum action_type {
			at_operator,
			at_return,
		};

		struct var {
			int value;
			bool ref;
		};

		struct decl_var {
			data_type type;
			int name;
		};

		struct action {
			action_type type;
			int ret_to;
			std::vector<var> arguments;
		};

		struct function {
			data_type ret_type;
			int name;
			std::vector<decl_var> arguments;
			std::vector<action> code;
		};

		virtual void define_function(function) = 0;

		virtual void flush(int) = 0;

	};
}

#endif